<br />
<div class="preragetitle" style="width: 300px;margin: 0 auto">
    <% if (!isFirstPage) { %>
    <span class="prepage">
    <a title="上一页" href="?p=<%= page-1 %>">上一页</a>
    </span>
    <% } %>
    <!--加一个for循环显示页码条-->
    <% for(var i =1;i <= Math.ceil(total/10) ;i++){ %>
    <span class="prepage">
        <a title="第<%= i %>页" href="?p=<%= i %>"><%= i %></a>
    </span>
    <%}%>
    <span class="prepage">
        <a title="首页" href="?p=1">首页</a>
        <a title="尾页" href="?p=Math.ceil(total/10)">尾页</a>
    </span>


    <% if (!isLastPage) { %>
    <span class="nextpage">
    <a title="下一页" href="?p=<%= page+1 %>">下一页</a>
    </span>
    <% } %>
</div>